#include "ModelAnimation.h"
#include "ModelPosture.h"
#include <tinyxml.h>

ModelAnimation::ModelAnimation()
{

}

ModelAnimation::ModelAnimation(const ModelAnimation&)
{

}

ModelAnimation::~ModelAnimation()
{

}

void ModelAnimation::Initialize(TiXmlElement* modelAnimationElement)
{
	mName = std::string(modelAnimationElement->Attribute("name"));
	mDuration = ::atoi(modelAnimationElement->Attribute("duration"));
	mId = ::atoi(modelAnimationElement->Attribute("id"));

	TiXmlElement* postureElement = modelAnimationElement->FirstChildElement( "Posture" );
	for( postureElement; postureElement; postureElement=postureElement->NextSiblingElement("Posture") )
	{
		ModelPosture* modelPosture = new ModelPosture();
		modelPosture->Initialize(postureElement);
		mPostures.push_back(modelPosture);
	}
}
